Public Function ViewportPickEx(frame As CD3DFrame, viewport As D3DVIEWPORT8, proj As D3DMATRIX, view As D3DMATRIX, world As D3DMATRIX, x As Single, y As Single) As Boolean
If frame.Enabled = False Then Exit Function
Dim vIn As D3DVECTOR, vNear As D3DVECTOR, vFar As D3DVECTOR, vDir As D3DVECTOR
Dim bHit As Boolean, i As Long
If frame Is Nothing Then Exit Function
Dim currentMatrix As D3DMATRIX
Dim NewWorldMatrix As D3DMATRIX
currentMatrix = frame.GetMatrix
'Setup our basis matrix for this frame
D3DXMatrixMultiply NewWorldMatrix, currentMatrix, world